'''
Created on 30-aug-2010

@author: LocalAdmin
'''
import os  
import re
import MySQLdb
from string import *
from ParsePCLintV001Functions import *

filesList=os.listdir("AllFiles")
i=0
for file in filesList:
  if re.search(r".*\.c",file):
    print file
    cmdstring="AllFiles\\pclintV001.bat AllFiles\\"+file+ " > Output\\output"+str(i)
    os.system(cmdstring)
    i=i+1

	
conn = MySQLdb.connect (host = "localhost",
                user = "root",
                passwd = "remyli",
                db = "pclintparse")
filesList=os.listdir("Output")
print filesList
for file in filesList:
  filename="Output\\"+file
  fp=open(filename,"r")
  parseFile(fp,file,conn)
conn.close ()
print "The End"








